<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>显示数据列表</title>
    <style type="text/css">
        table {
            border-collapse: collapse;
            margin: 0px auto 0px auto;
        }
        table th,td {
            border: 1px solid black;
            text-align: center;
        }
    </style>
</head>
<body>

    <table>
        <tr>
            <th>ID</th>
            <th>NAME</th>
            <th>PRICE</th>
            <th>DELETE</th>
            <th>EDIT</th>
        </tr>
        <tbody th:if="${#lists.isEmpty(movieList)}">
            <tr>
                <td colspan="5">抱歉！没有查询到您需要的数据！</td>
            </tr>
            <tr>
                <td colspan="5">
                    <a th:href="@{/add/movie/page}">添加新数据</a>
                </td>
            </tr>
        </tbody>
        <tbody th:if="${not #lists.isEmpty(movieList)}">
            <tr th:each="movie : ${movieList}">
                <td th:text="${movie.movieId}"></td>
                <td th:text="${movie.movieName}"></td>
                <td th:text="${movie.moviePrice}"></td>
                <td>
                    <a th:href="@{/remove/movie(movieId=${movie.movieId})}">删除</a>
                </td>
                <td>
                    <a th:href="@{/edit/movie(movieId=${movie.movieId})}">编辑</a>
                </td>
            </tr>
            <tr>
                <td colspan="5">
                    <a th:href="@{/add/movie/page}">添加新数据</a>
                </td>
            </tr>
        </tbody>
    </table>

</body>
</html>